<template>
	<view class="">
		发撒发发
	</view>
	<view style="height: 100rpx;font-size: 30rpx;position: relative;top: 100rpx;left: 300rpx;" @click="videoCapture">
		拍照
	</view>
</template>

<script setup>
	// 摄像
	// #ifdef  APP-PLUS
	
	const videoCapture = () => {
		var cmr = plus.camera.getCamera();
		// cmr.setSize({width:200rpx,height:100rpx})
		 // 设置录像分辨率
		      // const res = '640x480'; // 你可以根据需要选择不同的分辨率
		      // const fmt = 'mp4'; // 录像格式
		var res = cmr.supportedVideoResolutions[0];
		var fmt = cmr.supportedVideoFormats[0];
		console.log("Resolution: " + res + ", Format: " + fmt);
		cmr.startVideoCapture(function(path) {
				alert("Capture video success: " + path);
			},
			function(error) {
				alert("Capture video failed: " + error.message);
			}, {
				resolution: res,
				format: fmt
			}
		);
	}
	// #endif
</script>

<style lang="scss"></style>